package com.heyu.cgsd.util;

public class SpeedConvertUtils {
    private static final int MS = 0;
    private static final int C = 1;
    private static final int MA = 2;
    private static final int KMH = 3;
    private static final int KMS = 4;
    private static final int KN = 5;
    private static final int MPH = 6;
    private static final int IPS = 7;
    private static final int FPS = 8;

    private static double[] c = {1, 299792458, 340.3, 0.277777778, 1000, 0.514444444, 0.44704, 0.0254, 0.3048};

    public static double convert(double input, int srcUnit, int desUnit) {
        double result = input * c[srcUnit];

        return result / c[desUnit];
    }

    public static void main(String[] args) {
        double d = SpeedConvertUtils.convert(100, MS, MA);
    }
}
